﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FwProject.Authorization.Users;
using FwProject.Configuration;
using FwProject.Controllers;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using UEditorNetCore;
using Abp.Web;
using Abp.Auditing;
using Abp.Web.Models;

namespace FwProject.Web.Shop.Controllers
{
    [Route("api/[controller]")]
  
    public class UEditorController : FwProjectControllerBase
    {
        private readonly IHostingEnvironment env;
        private readonly IConfigurationRoot _appConfiguration;
        private UEditorService _ue;
        public UEditorController(IHostingEnvironment _env, UEditorService ue)
        {
             env = _env;
            _appConfiguration = env.GetAppConfiguration();
            _ue = ue;
        }
      
      
    

        [IgnoreAntiforgeryToken]
        [DisableAuditing]
        [WrapResult(false, false)]//关闭ABP的返回数据封装
        public void  Do() {
            Config.WebRootPath = _appConfiguration["FileServicePath:UEditor"];
            _ue.DoAction(HttpContext);
        }
    }
}
